fix: convert JAtoN from K&R to ANSI C function definition#234
Merged
zfields merged 1 commit intoblues:masterfrom Mar 8, 2026
Merged
fix: convert JAtoN from K&R to ANSI C function definition#234zfields merged 1 commit intoblues:masterfrom
zfields merged 1 commit intoblues:masterfrom
Conversation
n_atof.c used K&R (pre-ANSI C) style for the JAtoN function definition, separating parameter types from the parameter list. This is an obsolete style that GCC 15 rejects with -Wold-style-definition, and causes build failures in downstream projects that compile note-c sources with -Werror (e.g. on Debian Forky / Ubuntu 25.04 and later toolchains). Convert to a standard ANSI C prototype-style definition, preserving all the original inline parameter documentation.
zfields
approved these changes
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
n_atof.cuses a K&R (pre-ANSI C) style function definition forJAtoN, separating parameter types from the parameter list:GCC 15 (shipping with Debian Forky / Ubuntu 25.04 and later) now emits
-Wold-style-definitionfor this pattern. Downstream projects that compile note-c sources with-Werrorwill fail to build.This was discovered while validating note-posix, a POSIX platform SDK for the Notecard that compiles note-c sources directly with
-Wall -Wextra -Wpedantic -Werror.Fix
Convert to a standard ANSI C prototype-style definition, preserving all original inline parameter documentation:
Validation
Compiled cleanly with:
No functional changes — this is a purely syntactic fix.